load as many disk.img domains as there are loop devices. Added a
small function to get number of loop devices to be used as a max
for number of concurrent domains the test launches.
Signed-off-by: Daniel Stekloff <dsteklof@us.ibm.com>
import select
import signal
import re
+import glob
TEST_PASS = 0
TEST_FAIL = 255
domain.destroy()
return False
-
+
+#
+# We currently can only load as many concurrent HVM domains as loop
+# devices, need to find how many devices the system has.
+def getMaxHVMDomains():
+ nodes = glob.glob("/dev/loop*")
+ maxd = len(nodes)
+
+ return maxd
+
if __name__ == "__main__":
import time
import random
-MIN_DOMS = 10
-MAX_DOMS = 50
+if ENABLE_HVM_SUPPORT:
+ MAX_DOMS = getMaxHVMDomains()
+ if MAX_DOMS > 50:
+ MAX_DOMS = 50
+else:
+ MAX_DOMS = 50
+
+MIN_DOMS = 5
MEM_PER_DOM = 24
domains = []